/*************************************************************************
> File Name: 7.c
> Author: hzy
> Created Time: 2023-07-24 19:29:44
> Description: 7、二维数组的乘法（数组）两个a[3][5]  b[3][5]  -----> c[3][5] 。
************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(int argc, char const *argv[])
{
    int a[3][5] = {{1, 2, 3, 4, 5}, {1, 2, 3, 4, 5}, {1, 2, 3, 4, 5}};
    int b[3][5] = {{1, 2, 3, 4, 5}, {1, 2, 3, 4, 5}, {1, 2, 3, 4, 5}};
    int c[3][5] = {0};

    int i = 0, j = 0;
    int *p = &a[0][0];
    int *q = &b[0][0];
    int *k = &b[0][0];

    for (i = 0; i < 3; i++)
    {
        for (j = 0; j < 5; j++)
        {
            *(k+i*5+j) = *(p+i*5+j) * *(q+i*5+j);
        }
    }

    for (i = 0; i < 3; i++)
    {
        printf("\n");
        for (j = 0; j < 5; j++)
        {
            printf("%-4d", *(k+i*5+j));
        }
    }
    printf("\n");


    return 0;
}